<template>
	<view class="Select" @click.stop="selectThis(item)">
		<image src="/static/images/select.png" class="slectedIcon" v-if='checked'></image>
	</view>
</template>

<script>
	export default{
		props:{
			item:{
				type:Object,
				default:()=>{
					return null
				}
			}
		},
		data(){
			return {
				checked:false
			}
		},
		methods:{
			selectThis(item){
				this.checked=!this.checked;
				item.checked=!item.checked;
				this.$emit('select',item)
			}
		}
	}
</script>

<style scoped>
	.Select {
		width: 50rpx;
		height: 50rpx;
		border: 1rpx solid #bbb;
		border-radius: 6rpx;
		display: flex;
		align-items: center;
		justify-content: center;
	}
	.slectedIcon {
		width: 40rpx;
		height: 30rpx;
	}
</style>
